import Vue from 'vue'

import Cookies from 'js-cookie'

import 'normalize.css/normalize.css' // a modern alternative to CSS resets

import Element from 'element-ui'
import './styles/element-variables.scss'

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

import i18n from './lang' // internationalization
import './icons' // icon
import './permission' // permission control
import './utils/error-log' // error log

import * as filters from './filters' // global filters

import permission from '@/directive/permission/index.js' // 权限判断指令
import elDragDialog from '@/directive/el-drag-dialog'

import VueHighlightJS from 'vue-highlightjs'
import 'highlight.js/styles/atom-one-dark.css'
import * as echarts from 'echarts'
import iconPicker from 'e-icon-picker'
import 'e-icon-picker/lib/symbol.js' // 基本彩色图标库
import 'e-icon-picker/lib/index.css' // 基本样式，包含基本图标
import 'font-awesome/css/font-awesome.min.css' // font-awesome 图标库
import 'element-ui/lib/theme-chalk/icon.css' // element-ui 图标库
import uploadImage from '@/components/uploadImage/uploadImage'
import './utils/rem'
import './utils/derective' // 弹框拖动
// import BaiduMap from 'vue-baidu-map'
// Vue.use(BaiduMap, {
//     ak: '你申请的百度地图秘钥' //官方提供的ak秘钥
// })
import Pagination from '@/components/Pagination'
import plugins from './plugins' // plugins
Vue.use(plugins)
Vue.use(iconPicker, { FontAwesome: true, ElementUI: true, eIcon: true, eIconSymbol: true })

Vue.use(VueHighlightJS)
Vue.use(Element, {
    size: Cookies.get('size') || 'medium', // set element-ui default size
    i18n: (key, value) => i18n.t(key, value)
})
Vue.component('uploadImage', uploadImage)
Vue.component('Pagination', Pagination)


// register global utility filters
Object.keys(filters).forEach(key => {
    Vue.filter(key, filters[key])
})

Vue.directive('permission', permission)
Vue.directive('elDragDialog', elDragDialog)

Vue.config.productionTip = false
Vue.prototype.$echarts = echarts
console.log(router)
new Vue({
    el: '#app',
    router,
    store,
    i18n,
    render: h => h(App)
})
